package com.soap.service;

import org.apache.cxf.jaxws.EndpointImpl;

import javax.xml.ws.Endpoint;


/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2019/4/16 20:26
 */
public class ServerTest {
    public static void main(String[] args) {
        String address = "http://localhost:9002/soap/hello";
        final Endpoint endpoint = Endpoint.publish(address, new HelloServiceImpl());
        EndpointImpl endpoint1 = (EndpointImpl) endpoint;

        /*
        final List<Interceptor<? extends Message>> inInterceptors = endpoint1.getInInterceptors();
        // 添加自定义的拦截器
        inInterceptors.add(new CheckUserInterceptor());*/

        /*
        //添加日志入\拦截器
        final List<Interceptor<? extends Message>> inInterceptors = endpoint1.getInInterceptors();
        //添加日志入拦截器
        inInterceptors.add(new LoggingInInterceptor());
        final List<Interceptor<? extends Message>> outFaultInterceptors = endpoint1.getOutInterceptors();
        //添加日志出拦截器
        outFaultInterceptors.add(new LoggingOutInterceptor());*/

        String address2 = "http://localhost:9002/soap/student";
        Endpoint.publish(address2, new StudentWsImpl());
        System.out.println("web service start...");
    }
}
